{% if is_paginated %}
{% load i18n %}
{{ request }}
<div class="pages">
    {% if page_obj.has_previous %}
        <a title="{% trans 'goto' %} {% trans 'previous page' %}" href="?{{ getvars }}page={{ page_obj.previous_page_number }}" class="nextprev">&lsaquo;&lsaquo; {% trans 'previous' %}</a>
    {% else %}
        <span class="nextprev">&lsaquo;&lsaquo; {% trans 'previous' %}</span>
    {% endif %}
    
    {% for page in paginator.page_range|slice:":20" %}
        {% ifequal page page_obj.number %}
            <span class="current">{{ page }}</span>
        {% else %}
            <a title="goto page {{ page }}" href="?{{ getvars }}page={{ page }}" class="page">{{ page }}</a>
        {% endifequal %}
        
        {% if forloop.last %}
        	{% ifnotequal forloop.counter paginator.num_pages %}
            <span class="none">...</span>
            <a title="goto page {{ paginator.num_pages }}" href="?{{ getvars }}page={{ paginator.num_pages }}" class="page">{{ paginator.num_pages }}</a>
            {% endifnotequal %}
        {% endif %}
    {% endfor %}
    
    {% if page_obj.has_next %}
        <a title="{% trans 'goto' %} {% trans 'next page' %}" href="?{{ getvars }}page={{ page_obj.next_page_number }}" class="nextprev">{% trans 'next' %} &rsaquo;&rsaquo;</a>
    {% else %}
        <span class="nextprev">{% trans 'next' %} &rsaquo;&rsaquo;</span>
    {% endif %}
</div>
{% endif %}